Skip to content

DEVOPS-3406 - Update hook-delete-policy for migration Job and RBAC to prevent sync issues - #6

Merged
raul-gherman-modaoperandi merged 24 commits into
devfrom
DEVOPS-3406
Sep 17, 2026
Merged

raul-gherman-modaoperandi merged 24 commits into
devfrom
DEVOPS-3406

Conversation

@raul-gherman-modaoperandi

Copy link
Copy Markdown

No description provided.

Copilot AI balanced review requested due to automatic review settings September 15, 2026 14:18
@raul-gherman-modaoperandi raul-gherman-modaoperandi changed the title DEVOPS-3406 - Update hook-delete-policy for migration Job and RBAC to… DEVOPS-3406 - Update hook-delete-policy for migration Job and RBAC to prevent sync issues Sep 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The remaining Helm-hook lifecycle issues can still cause upgrade failures and sync races.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request updates Helm hook cleanup behavior for migration Jobs, RBAC, and ExternalSecret resources.

Changes:

  • Adds hook-failed to the migration Job policy.
  • Removes explicit delete policies from RBAC and ExternalSecret hooks.
  • Updates tests and documentation.

Two critical issues remain: the ExternalSecret and migration RBAC resources are still Helm hooks, so removing their delete policies does not resolve their upgrade lifecycle and sync issues.

File summaries
File Summary
packaging/helm/openwork-ee/values.yaml Updates the default migration Job policy.
packaging/helm/openwork-ee/tests/external-secrets.sh Adjusts rendered hook-policy assertions.
packaging/helm/openwork-ee/templates/migration-rbac.yaml Removes explicit RBAC hook delete policies.
packaging/helm/openwork-ee/templates/externalsecret.yaml Removes the ExternalSecret delete policy.
packaging/helm/openwork-ee/README.md Documents the lifecycle changes.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +11 to +15
on every sync. before-hook-creation would instead race ArgoCD's own
delete-then-create sequencing on automated-sync retries — a delete that
hasn't fully propagated before the following create attempt reports
"already exists" and fails the whole sync, sometimes indefinitely. Ordering
via hook-weight alone, applied in place like a normal manifest, avoids that

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid

…migration RBAC; update Namespace handling for ArgoCD compatibility
Copilot AI review requested due to automatic review settings September 15, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The default ArgoCD namespace hook can delete and recreate the release namespace, and related documentation comments need correction.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

packaging/helm/openwork-ee/README.md:128

  • This user-facing warning also omits the migrations.hook condition: with hook: false, the template emits a normal Namespace manifest and ArgoCD does not run the destructive hook lifecycle described here. Qualify the warning and the every-sync statement so the documented troubleshooting configuration is not described as a hook.
**This safety check does not work under ArgoCD.** ArgoCD renders charts with
`helm template` in its repo-server, which has no live cluster connection, so
`lookup` always returns empty there — the Namespace hook renders on every
single sync, unconditionally. Helm and ArgoCD both document that a hook
without an explicit `hook-delete-policy` defaults to `before-hook-creation`

packaging/helm/openwork-ee/README.md:135

  • This ArgoCD recipe also needs the chart namespace value to match spec.destination.namespace: every namespaced manifest uses .Values.namespace explicitly, while CreateNamespace=true creates only the Application destination namespace. Without that alignment, ArgoCD creates one namespace but the chart still targets another and the sync fails.
Set `createNamespace: false` for any ArgoCD `Application` and instead let
ArgoCD create the namespace itself:

packaging/helm/openwork-ee/templates/namespace.yaml:13

  • The new template comment overstates the ArgoCD behavior: templates/namespace.yaml adds hook annotations only when migrations.hook is true, while migrations.hook: false renders this Namespace as a normal manifest (the README even documents that setting for troubleshooting). Qualify the every-sync hook warning with that condition so operators do not apply the hook lifecycle explanation to the non-hook path.
  means under ArgoCD this Namespace unconditionally renders as a hook on
  every single sync — and, same as any Helm/Argo CD hook with no explicit
  hook-delete-policy, it defaults to before-hook-creation (Argo CD: "if no
  deletion policy is specified, Argo CD will automatically assume
  BeforeHookCreation rules"; Helm's docs state the identical default).
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment thread packaging/helm/openwork-ee/values.yaml Resolved
Comment thread packaging/helm/openwork-ee/values.yaml Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The values.yaml hook-policy explanation contradicts the policies rendered by the RBAC and ExternalSecret templates.

Review details

Suppressed comments (2)

packaging/helm/openwork-ee/values.yaml:423

  • This comment is now inconsistent with the rendered chart: templates/migration-rbac.yaml and templates/externalsecret.yaml still emit hook-delete-policy: before-hook-creation, and the tests assert those annotations. Please update the explanation so it says these hooks keep an explicit delete policy rather than claiming they no longer carry one.
  # object, unlike the idempotent RBAC/ExternalSecret hooks which no longer
  # carry a delete policy at all). hook-succeeded and hook-failed additionally

packaging/helm/openwork-ee/values.yaml:423

  • These lines say the RBAC/ExternalSecret hooks “no longer carry a delete policy,” but both templates explicitly render helm.sh/hook-delete-policy: before-hook-creation (templates/migration-rbac.yaml:34,48,67 and templates/externalsecret.yaml:34). That makes the operational guidance contradictory and could lead an operator to assume those hooks are not deleted/recreated; describe the policy as explicit instead.
  # object, unlike the idempotent RBAC/ExternalSecret hooks which no longer
  # carry a delete policy at all). hook-succeeded and hook-failed additionally
  • Files reviewed: 7/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Copilot AI review requested due to automatic review settings September 15, 2026 15:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Direct Helm examples need namespace provisioning updates, and ExternalSecret lifecycle documentation requires correction.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

Previously missed (3) — in code that hasn't changed since the last review.

packaging/helm/openwork-ee/README.md:1076

  • This new explanation also claims the ExternalSecret has no finalizer and therefore deletes essentially instantly. With the chart's default Owner creation policy and Retain deletion policy, ESO must perform ownership cleanup to preserve the target Secret, so deletion can wait on the ESO controller. Please correct this operational claim rather than presenting before-hook-creation as unable to block.
    packaging/helm/openwork-ee/templates/externalsecret.yaml:26
  • With the chart's default target.creationPolicy: Owner and deletionPolicy: Retain, ESO must coordinate ownership cleanup when this ExternalSecret is deleted; it is not safe to describe it as a resource with no finalizer or an essentially instantaneous delete. If ESO is unavailable, before-hook-creation can wait on that cleanup and still block the next sync—the exact failure mode this change is documenting as solved. Please make the comment reflect the controller/finalizer dependency rather than asserting that it cannot block.
    packaging/helm/openwork-ee/tests/external-secrets.sh:311
  • This test comment repeats the incorrect assumption that the ExternalSecret has no finalizer. The chart defaults it to creationPolicy: Owner plus deletionPolicy: Retain, which requires ESO to coordinate ownership cleanup when the CR is deleted; that delete can wait if ESO is unavailable. Update the explanation so the test does not document a false guarantee about hook deletion completing immediately.
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

# --create-namespace and cannot pre-provision the namespace out of band. Under
# ArgoCD, create the namespace via `syncOptions: [CreateNamespace=true]`
# instead; see "Namespace creation under ArgoCD" in README.md.
createNamespace: false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

valid

Copilot AI review requested due to automatic review settings September 15, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical namespace lifecycle regression and a moderate installation mismatch remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

packaging/helm/openwork-ee/values.yaml:26

  • This new default also affects the separate end-user install command in packages/docs/start-here/self-host.mdx:28-30, which still omits both --namespace and --create-namespace. On a fresh cluster that command leaves the release namespace as default while the chart's migration hooks target the default openwork value, so the hooks fail because openwork does not exist. Update that guide alongside this default change (and keep the Helm release namespace aligned with the chart value).
createNamespace: false
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

add assert_not_contains function and update logic for migrations.hook to ensure proper rendering of Namespace resources.
Copilot AI review requested due to automatic review settings September 15, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate namespace lifecycle and installation issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

packaging/helm/openwork-ee/templates/namespace.yaml:76

  • When migrations.hook=false, this branch emits the Namespace as an ordinary release-managed resource. helm uninstall will therefore delete the Namespace, unlike the hook path described above, and Kubernetes namespace deletion cascades to all workloads and any externally managed objects in it. Preserve the namespace on uninstall (for example with helm.sh/resource-policy: keep) or otherwise document and implement a non-deleting lifecycle for this supported mode.
apiVersion: v1

packaging/helm/openwork-ee/values.yaml:26

  • With createNamespace now defaulting to false, the canonical self-host install command in packages/docs/start-here/self-host.mdx:27-31 still omits both --namespace/--create-namespace (and any namespace provisioning step). On a fresh cluster that leaves the chart's default openwork namespace absent while the migration hooks target it, so the documented install fails. Update that entry point and any other direct-Helm documentation alongside this default change.
createNamespace: false

packaging/helm/openwork-ee/values.yaml:23

  • The opt-in path is described as bootstrapping a fresh namespace without --create-namespace, but a Helm install cannot use a chart hook to create the namespace it uses for release storage: Helm must access the release namespace before executing hooks. With --namespace aligned to .Values.namespace, a missing namespace therefore fails before this hook can run; this only works when Helm's release namespace already exists or differs from the namespace being created. Please require --create-namespace/pre-provisioning for the aligned case, or redesign and document the release-namespace split.
# in the release — on every single sync. Set true only for a genuine `helm
# install`/`helm upgrade` CLI workflow that does not already pass
# --create-namespace and cannot pre-provision the namespace out of band. Under
  • Files reviewed: 7/7 changed files
  • Comments generated: 2
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment thread packaging/helm/openwork-ee/values.yaml Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Namespace lifecycle changes can break fresh installs and delete legacy namespaces during upgrades.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

packaging/helm/openwork-ee/templates/namespace.yaml:92

  • The new keep annotation does not protect legacy releases when switching migrations.hook: false to true: the hook branch's lookup finds the existing Namespace and emits no manifest, so this annotation is never applied. A release created by the previous chart had a plain Namespace without keep; Helm can therefore see it removed from the release and delete it during that upgrade, cascading the namespace. Preserve/migrate the legacy resource before entering the lookup-and-omit path.
    "helm.sh/resource-policy": keep

packaging/helm/openwork-ee/templates/namespace.yaml:94

  • With migrations.hook=false, this branch now always emits a plain Namespace. A fresh or reinstall Helm operation into an already existing namespace (including one just created by --create-namespace) will see an unowned Namespace in the rendered manifest and fail with an existing-resource/ownership error; helm.sh/resource-policy: keep only affects deletion and does not make Helm adopt it. Keep an install-time lookup skip while preserving the resource in upgrade manifests, or use another ownership-safe path, and cover the live install case.
{{- else }}

packaging/helm/openwork-ee/values.yaml:26

  • This default change is still destructive for an existing release that used the old default with migrations.hook: false: the old chart rendered the Namespace as a normal tracked resource without helm.sh/resource-policy: keep, while this value now makes the template render nothing. Helm can therefore treat that Namespace as removed before the new keep annotation is ever applied and delete it, cascading to all workloads in the namespace. Preserve/migrate that legacy resource (or require an explicit transition/opt-in) before changing the default.
createNamespace: false
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment thread packaging/helm/openwork-ee/values.yaml Resolved
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI and others added 3 commits September 17, 2026 06:21
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Copilot AI and others added 2 commits September 17, 2026 06:24
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Copilot AI and others added 4 commits September 17, 2026 06:26
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved namespace lifecycle, ExternalSecret finalization, and live-regression coverage issues block approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

packaging/helm/openwork-ee/README.md:1175

  • This documentation repeats the false assumption that ExternalSecret deletion has no finalizer. ESO adds a cleanup finalizer under the chart's default creationPolicy: Owner, so a before-hook-creation delete can remain Terminating and race the next hook creation; deletionPolicy: Retain only preserves the target Secret. Documenting this as safe hides the sync failure mode the PR is intended to prevent.
leave it undocumented. It is tolerable for these leaf, non-cascading resources
(no finalizers, so the delete completes essentially instantly, and the
ExternalSecret's `target.deletionPolicy: Retain` protects the materialized
Secret regardless). It is *not* tolerable for the Namespace hook, because

packaging/helm/openwork-ee/templates/externalsecret.yaml:25

  • The claim that this ExternalSecret has no finalizer is not valid for the chart's default ESO setup (creationPolicy: Owner): External Secrets adds a cleanup finalizer to ExternalSecret objects. A before-hook-creation delete can therefore leave the old object Terminating while the next hook tries to create the same name, so deletionPolicy: Retain protects the materialized Secret but does not remove this sync race. Please use a lifecycle that avoids this delete/recreate dependency (or explicitly wait/retry around ESO finalization) instead of documenting the existing hook policy as safe.
    here: this is a leaf, non-cascading resource with no finalizer, so the
    delete completes near-instantly; and target.deletionPolicy defaults to
    Retain, so even a brief gap between the old ExternalSecret's deletion and
    the new one's creation never deletes the materialized Secret workloads

packaging/helm/openwork-ee/templates/namespace.yaml:178

  • When a Namespace already exists but has neither the safe marker nor this release's Helm ownership metadata, this branch still renders it as a pre-install,pre-upgrade hook when createNamespace=true. The hook's implicit before-hook-creation cleanup can delete that pre-existing Namespace before recreating it, cascading through its workloads; the resource-policy: keep in the newly rendered hook is too late. This contradicts the documented non-destructive handling for an externally created Namespace. Fail or omit when an existing Namespace is not owned instead of taking the fresh-create hook path.
  annotations:
    "helm.sh/resource-policy": keep
{{- else if .Values.createNamespace }}
{{- fail (printf "namespace %q already exists but is not owned by Helm release %q; set createNamespace=false or provision it for this release" $namespaceName .Release.Name) }}
apiVersion: v1
kind: Namespace
metadata:
  name: {{ include "openwork-ee.namespace" . }}
  labels:
    {{- include "openwork-ee.labels" . | nindent 4 }}
  annotations:

packaging/helm/openwork-ee/templates/namespace.yaml:132

  • This unconditional cluster-scoped lookup regresses the documented createNamespace=false path: a direct Helm install into an already-provisioned namespace now requires the caller to have get permission on all Namespaces, even though the chart will not render or manage a Namespace. A restricted Helm identity therefore fails with a Forbidden error before rendering the namespaced resources. Preserve a no-cluster-read path for the default/out-of-band mode, or make the legacy migration an explicitly privileged opt-in.
{{- if .Values.createNamespace -}}

packaging/helm/openwork-ee/tests/external-secrets.sh:312

  • This repeated justification is inaccurate for the default External Secrets Operator behavior: the ExternalSecret is given a cleanup finalizer, so before-hook-creation can leave the old hook Terminating and make the next same-name create race or fail. target.deletionPolicy: Retain protects the generated Secret, but it does not make ExternalSecret deletion instantaneous; the sync-safe lifecycle needs to be changed rather than described as tolerable.
# It is tolerable for these four because they are leaf, non-cascading
# resources with no finalizers (a delete completes near-instantly, so the
# following create essentially never collides), and the ExternalSecret's
# target.deletionPolicy: Retain means even a brief gap never touches the
# materialized Secret workloads read from. The migration Job needs the same
  • Files reviewed: 13/13 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment on lines +161 to +168
# Critical regression this fixture CANNOT exercise (no live cluster access
# from `helm template`), verified instead with real helm install/upgrade
# cycles against a live cluster using the actual chart: createNamespace
# defaulted to false in the same chart version that flipped this default, so
# an existing release that had createNamespace=true (the old default) and
# relied on the implicit default rather than pinning it explicitly would, on
# its very next upgrade with this chart version and no other changes,
# evaluate createNamespace as false. The lookup + ownership-detection logic
Copilot AI review requested due to automatic review settings September 17, 2026 06:29
Co-authored-by: raul-gherman-modaoperandi <68240333+raul-gherman-modaoperandi@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Namespace migration handling and README guidance have unresolved issues that may risk pruning existing namespaces and mislead operators.

Review details

Suppressed comments (4)

packaging/helm/openwork-ee/README.md:247

  • This claim conflicts with the template: when createNamespace is left at its new default false, the lookup is not performed, and the legacy migrations.hook: false upgrade fails at the guard unless confirmNoLegacyPlainNamespace=true is supplied. The automatic in-place migration only occurs when an operator enables createNamespace=true for the migration upgrade, so the README should not say that no operator action is required.
`Prune=false`, or add equivalent protection another way, before later omission.
The direct Helm `createNamespace=true` path and the explicit
`migrateLegacyPlainNamespace=true` render were both verified separately.

packaging/helm/openwork-ee/README.md:1184

  • This statement is inaccurate for the migration branch: when lookup finds an existing unmarked Namespace owned by this release, lines 161-169 render it as a plain manifest to add resource-policy: keep, even when createNamespace=true. Saying the Namespace is always a hook can lead operators to expect hook lifecycle semantics; clarify that only a newly created opt-in Namespace is rendered as a hook.
  enabled: true
  hook: false
  backoffLimit: 0
**packaging/helm/openwork-ee/README.md:1184**
* With the new fail-closed condition in `templates/namespace.yaml`, `migrations.hook` now affects whether the chart renders at all: an upgrade with `createNamespace=false` and `hook=false` aborts unless the legacy-namespace confirmation is supplied. Thus the troubleshooting block immediately below, which only sets `hook: false` and `backoffLimit: 0`, no longer works for an existing release using the new default; document the required migration/confirmation and its safety check here.

enabled: true
hook: false
backoffLimit: 0

packaging/helm/openwork-ee/templates/namespace.yaml:146

  • This guard still misses the documented migrations.hook: false → true transition. With the new default createNamespace=false, the lookup above is skipped and $existing remains empty; when the current value is true, this condition is false, so the not $existing branch emits no Namespace. A release that previously rendered a plain, Helm-managed Namespace while hook=false can therefore have that Namespace pruned (and its contents cascaded) on upgrade. Preserve that legacy object or require an explicit migration/confirmation independent of the current hook value.
    (eq (get $existingAnnotations "meta.helm.sh/release-name" | default "") .Release.Name)
    (eq (get $existingAnnotations "meta.helm.sh/release-namespace" | default "") .Release.Namespace)
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Copilot AI review requested due to automatic review settings September 17, 2026 06:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Documentation inaccuracies, missing live-cluster test coverage, and an unintended chart artifact remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

Previously missed (1) — in code that hasn't changed since the last review.

packaging/helm/openwork-ee/templates/namespace.yaml:121

  • This explanation does not match the implementation: the else if .Values.createNamespace branch at lines 181-182 calls fail, so an existing unowned Namespace fails during template rendering and never reaches Helm's apply-time ownership check or a rendered hook. Please describe the actual render-time failure so operators get accurate migration guidance.

packaging/helm/openwork-ee/AGENTS.md:3

  • This file sits at the chart root, and the publish workflow runs helm package without a .helmignore; Helm therefore includes AGENTS.md in every published OCI chart. These agent-only repository instructions are not chart inputs and add an unintended artifact for chart consumers. Keep the scoped instructions outside the chart or exclude this file via .helmignore.
# AGENTS.md

Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.

packaging/helm/openwork-ee/README.md:190

  • This says the chart automatically migrates the legacy plain Namespace without requiring createNamespace: true, but the template performs its live lookup and ownership migration only inside the if .Values.createNamespace block. With the new default false, the chart cannot detect that legacy object and renders nothing unless migrateLegacyPlainNamespace=true is explicitly set; please make the documented operator action match the template.
Given that, this chart automatically detects and never disturbs a Namespace
that is already safe, and on direct Helm runs with live-cluster `lookup`
access safely migrates the one population that is not — without requiring
`createNamespace: true`, which matters because this same chart version also
flips that default from `true` to `false` (see above). For no-lookup renders

packaging/helm/openwork-ee/README.md:1174

  • The final sentence is broader than the template's behavior. When createNamespace=true finds an existing release-owned plain Namespace, lines 172-180 render it as a plain manifest, and already-safe Namespaces are omitted; only a newly created Namespace takes the hook form. Please document these cases instead of saying the Namespace is always a hook whenever createNamespace is true.
`migrations.hook` only ever affects the ExternalSecret, migration RBAC, and
migration Job above — it never affects the Namespace (see "Namespace creation
under ArgoCD"), which is always a hook whenever `createNamespace` is true,
independent of this value.

packaging/helm/openwork-ee/templates/namespace.yaml:147

  • The new live-cluster decision branches are not exercised by the chart tests: every added case uses helm template, so lookup is empty and $alreadySafe, $ownedByThisRelease, and the foreign-namespace fail path never run. These branches decide whether an existing Namespace is omitted or patched—the safety-critical behavior that prevents cascading deletion—so add a Kubernetes-backed upgrade test (or equivalent CI proof) for these states.
{{- $alreadySafe := or (hasKey $existingAnnotations "helm.sh/hook") (eq (get $existingAnnotations "helm.sh/resource-policy" | default "") "keep") -}}
{{- $ownedByThisRelease := and $existing
    (eq (get $existingAnnotations "meta.helm.sh/release-name" | default "") .Release.Name)
    (eq (get $existingAnnotations "meta.helm.sh/release-namespace" | default "") .Release.Namespace)
    (eq (get $existingLabels "app.kubernetes.io/managed-by" | default "") "Helm") -}}
  • Files reviewed: 13/13 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.

Comment on lines +221 to +226
- If `createNamespace=false`, the chart skips that live-cluster `lookup` path
entirely and omits the Namespace by default. For the legacy GitOps /
no-lookup migration case, set `migrateLegacyPlainNamespace=true` for one
release so the chart renders a plain Namespace with both
`helm.sh/resource-policy: keep` and ArgoCD `Prune=false` before later
omission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants